<?php
    if($lang == 'en')
        $locale = 'en_GB';
    else
        $locale = 'de_DE';
    
    require 'phpincludes/webpageconfig.php';
    require 'phpincludes/fbconfig.php';
?>
<div id="fb-root"></div>
<script>
    window.fbAsyncInit = function(){
        // init the FB JS SDK
        FB.init({
          appId      : '<?php echo $fbappid ?>',                 // App ID from the app dashboard
          channelUrl : '<?php echo $webpagedir ?>/channel.php', // Channel file for x-domain comms
          status     : true,                                 // Check Facebook Login status
          xfbml      : true                                  // Look for social plugins on the page
        });

        // Additional initialization code such as adding Event Listeners goes here
      };
    
    (function(d, s, id){
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s); js.id = id;
        js.src = "//connect.facebook.net/<?php echo $locale ?>/all.js";
        fjs.parentNode.insertBefore(js, fjs);
    }
    
    (document, 'script', 'facebook-jssdk'));
</script>